package main;

public class Singleton {
    private static final Singleton singleton = new Singleton();
    // 私有构造函数，保证只有内部调用
    private Singleton() {
        System.out.println("生成了一个实例");
    }
    //返回单实例
    public static Singleton getInstance(){
        return Singleton.singleton;
    }
}
